# $Id$
# Maintainer: Jan de Groot <jgc@archlinux.org>

pkgbase=libpst
pkgname=('libpst' 'libpst-docs')
pkgver=0.6.70
pkgrel=3
arch=('i686' 'x86_64')
url="http://www.five-ten-sg.com/libpst/"
license=('GPL')
makedepends=('python2' 'boost' 'libgsf')
source=(http://www.five-ten-sg.com/libpst/packages/${pkgbase}-${pkgver}.tar.gz)
sha256sums=('19981c0661305d093e7df8cf579662c6157ffb38a7873091cfc9e900fb4667d4')

build() {
  cd $pkgbase-$pkgver
  ./configure --prefix=/usr --mandir=/usr/share/man \
      --disable-static --enable-libpst-shared --disable-dii PYTHON_VERSION=2
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

package_libpst() {
  pkgdesc="Outlook .pst file converter"
  depends=('gcc-libs' 'libgsf')
  optdepends=('boost-libs: for libpst python interface')
  options=('!docs')

  cd $pkgbase-$pkgver
  make DESTDIR="${pkgdir}" install
}

package_libpst-docs() {
  pkgdesc="Documentation for Outlook .pst file converter"
  options=('docs')

  cd $pkgbase-$pkgver
  make DESTDIR="${pkgdir}" install-htmlDATA
  cd html
  make DESTDIR="${pkgdir}" install-htmldevelDATA
}
